<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue事件绑定</title>
</head>
<body>
<div>
    <input type="button" value="按钮1" v-on:click="f()">
    <input type="button" value="按钮2" @click="f()">
    {{msg}}
</div>
<script src="../js/vue.js"></script>
<script>
    let v = new Vue({
        el: "div",
        data: {
            msg: "事件绑定"
        },
        methods:{
            // f:function () {
            //   v.msg="按钮点击了!"
            // },
            f(){
                v.msg="按钮点击了!"
            }
        }
    })
</script>
</body>
</html>